<!--
 * @Author: zengwj
 * @Date: 2022-06-22 10:58:29
 * @LastEditors: zengwj
 * @LastEditTime: 2022-06-22 13:39:53
 * @Description: 
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    // function func() {
    //   // console.log(this, this.__proto__ === func.prototype)
    // }

    // const boundFunc = func.bind(1)
    // const newf = new boundFunc()
    // console.log(newf.__proto__ === func.prototype)

    // function outerFunc() {
    //   console.log(this) // { x: 1 }

    //   function func() {
    //     console.log(this) // Window
    //   }

    //   func()
    // }

    // outerFunc.bind({ x: 1 })()


    obj = {
      func() {
        const arrowFunc = () => {
          console.log(this._name)
        }

        return arrowFunc
      },

      _name: "obj",
    }

    // obj.func()()  //obj

    // func = obj.func
    // func()()  //window

    // obj.func.bind({ _name: "newObj" })()()//newobj

    // obj.func.bind()()()//undefined 

    obj.func.bind().apply({ _name: "applyObj" })()


  </script>
</body>

</html>